<!DOCTYPE html>
<html>
<head>
    {template head}
</head>
<body class="bg pad">
<div class="banner top_slide_wrap">
    <ul class="bxslider">
        <li>
            <a href="javascript:;" target="_blank"><img src="{$pic['pic_photo1']}" alt="banner"></a>
        </li>
        <li>
            <a href="javascript:;" target="_blank"><img src="{$pic['pic_photo2']}" alt="banner"></a>
        </li>
        <li>
            <a href="javascript:;" target="_blank"><img src="{$pic['pic_photo3']}" alt="banner"></a>
        </li>
    </ul>
    <script type="text/javascript">
        $(function () {
            $(".banner .bxslider").bxSlider({
                auto: true,
                prevSelector: $(".top_slide_wrap .op_prev")[0],
                nextSelector: $(".top_slide_wrap .op_next")[0],
                pause: 6e3
            });
        });
    </script>

</div>
<nav class="sel_nav">
    <ul>
        <li>
            <a href="javascript:;">
                <select name="position_id" id="position_id">
                    <option value="" selected="selected">所有职位</option>
                    {loop $position_list $t}
                    <option {if $position_id==$t[position_name]}selected{/if} value="{$t['position_name']}">{$t[position_name]}</option>
                    {/loop}
                </select>
            </a>
        </li>
        <li>
            <a href="javascript:;">
                <select name="work_id" id="work_id">
                    <option value="" selected="selected">所有工种</option>
                    {loop $work $w}
                    <option {if $work_id==$w[work_id]}selected{/if} value="{$w[work_id]}">{$w[work_name]}</option>
                    {/loop}
                </select>
            </a>
        </li>
        <li>
            <a href="javascript:;">
                <input id="demo1" type="text" readonly="" value="{$area_id?$area_id:'区域'}">
                <input type="hidden" name="area_id" value="" id="value1">
            </a>
        </li>
        <li>
            <a href="javascript:;">
                <select id="search_id">
                    <option value="" selected="selected">智能检索</option>
                    <option {if $search_id==1}selected{/if} value="1">最新发布</option>
                    <option {if $search_id==2}selected{/if} value="2">热门发布</option>
                </select>
            </a>
        </li>
    </ul>
</nav>
<section class="flist">
    <ul id="jobs_list">
        {if count($result)>0}
        {loop $result $t}
        <li>
            <img src="{SITE_THEME}img/tou.png" class="tou">
            <div class="text" style="width:60%;">
                <h3>{$t['jobs_name']}</h3>
                <p>{$t['jobs_sex']=='男'?'男':'女'}、{$t['jobs_age']}</p>
                <p>{$t['jobs_area']}</p>
            </div>
            <div class="ep" style="width:40%;">
                <h3>{$t['jobs_position']}</h3>
                {if $shoufei==1 || $num[total]>=1}
                <a href="{url('zhou_jobs/detail',array('id'=>$t['jobs_id']))}">立即招聘</a>
                {else if $shoufei==2}
                <a href="javascript:;" onclick="show_alert()">立即招聘</a>
                {/if}
            </div>
        </li>
        {/loop}
        {else}
        <p align="center" style="padding:20px 0;">暂时没有找到数据！</p>
        {/if}
    </ul>
    <a id="more_div" class="more">正在加载</a>
    <input type="hidden" id="page" value="2" >
    <script type="text/javascript">
        $(function(){
            $("#page").val(2);
            pagereturn();
            function showAjax(){
                $("#more_div").css("display","block");
                var page = $("#page").val();
                $.ajax({
                    url:"{url('zhou_jobs/ajax_jobs_list')}&page="+page+"{$myurl}",
                    type:"GET",
                    dateType:"json_encode",
                    success:function(data){
                        if(data == 1){
                            $("#more_div").html("已经加载到最底了");
                            return false;
                        }
                        $("#jobs_list").append(data);
                        $("#page").val(parseInt(page)+1);
                        $("#more_div").css("display","block");
                    }
                })
            }

            function pagereturn(){
                var page = $("#page").val();
                $.ajax({
                    url:"{url('zhou_jobs/ajax_jobs_list')}&page="+page+"{$myurl}",
                    type:"GET",
                    dateType:"json_encode",
                    success:function(data){
                        if(data == 1){
                            $("#more_div").css("display","none");
                            return false;
                        }
                    }
                })
            }

            var tur = true;
            function scrollFn(){
                //真实内容的高度
                var pageHeight = Math.max(document.body.scrollHeight,document.body.offsetHeight);
                //视窗的高度
                var viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
                //隐藏的高度
                var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
                tur = true;
                if(pageHeight - viewportHeight - scrollHeight < 1){    //如果满足触发条件，执行
                    showAjax();
                    return false;
                }
            }
            $(window).scroll(function() {
                if(tur){ setTimeout(scrollFn,800);
                    tur = false;
                }else{
                }
            });//绑定滚动事件
        })
    </script>
</section>

<footer class="footer">
    <a href="{url('zhou_jobs/jobs_edit')}">
        <img src="{SITE_THEME}img/icon2.png">
        <p>发布求职</p>
    </a>
</footer>
<div class="alert">
    <div class="tan">
        <div class="txt">
            <img src="{SITE_THEME}img/icon3.png">
            <span>抱歉！您还未支付
					支付完成后才可查看</span>
        </div>
        <div class="aa">
            <a href="javascript:;" class="qu" onclick="hide_alert()">取消</a>
            <a href="../pay_need.html" class="sure">去支付</a>
        </div>
    </div>
</div>
<script>
    function show_alert(){
        $(".alert").show()
    }
    function hide_alert() {
        $(".alert").hide()
    }

    function unsure_click(){
        location.href = "index.php?c=zhou_jobs&a=jobs_list&typeid={$typeid}&position_id={$position_id}&work_id={$work_id}&area_id=&search_id={$search_id}";
    }
    function  sure_click() {
        location.href = "index.php?c=zhou_jobs&a=jobs_list&typeid={$typeid}&position_id={$position_id}&work_id={$work_id}&area_id="+$("#value1").val()+"&search_id={$search_id}";
    }
    $('#position_id').change(function () {
        location.href = "index.php?c=zhou_jobs&a=jobs_list&typeid={$typeid}&position_id="+$(this).val()+"&work_id={$work_id}&area_id={$area_id}&search_id={$search_id}";
    });
    $('#work_id').change(function () {
        location.href = "index.php?c=zhou_jobs&a=jobs_list&typeid={$typeid}&position_id={$position_id}&work_id="+$(this).val()+"&area_id={$area_id}&search_id={$search_id}";
    });
    $('#search_id').change(function () {
        location.href = "index.php?c=zhou_jobs&a=jobs_list&typeid={$typeid}&position_id={$position_id}&work_id={$work_id}&area_id={$area_id}&search_id="+$(this).val();
    });

    var area = new LArea();
    var LAreaData = {$arr};
    area.init({
        'trigger': '#demo1',//触发选择控件的文本框，同时选择完毕后name属性输出到该位置
        'valueTo':'#value1',//选择完毕后id属性输出到该位置
        'keys':{id:'name',name:'name'},//绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
        'type':1,//数据源类型
        'data':LAreaData//数据源
    });

</script>
</body>
</html>
